package com.spring.lesson001.demo3;

/**
 * @author vhans
 */
public class UserFactory {
    public User1 buildUser1() {
        System.out.println("==========");
        User1 user1 = new User1();
        user1.setName("通过实例工厂无参方法创建");
        return user1;
    }

    public User1 buildUser2(String name, int age) {
        System.out.println("==========");
        User1 user1 = new User1();
        user1.setName(name);
        user1.setAge(age);
        return user1;
    }
}
